package xc.com.course.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xc.com.course.domain.Category;
import xc.com.course.service.CategoryService;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhuolizhong
 * @since 2021-06-03
 */
@RestController
@RequestMapping("/category")
@Api(tags = "Category接口",description = "分类表的增删改查")
@CrossOrigin
public class CategoryController {
     @Autowired
    private CategoryService categoryService;

     @GetMapping
     @ApiOperation("查询所有分类")
    public List<Category> findall(){
         List<Category> categories = categoryService.findall();
         return categories;
     }
}

